// MapboxDraw CSS修复
// 确保MapboxDraw的canvas层在最上面

.mapboxgl-canvas-container.mapboxgl-interactive {
  cursor: inherit !important;
}

.mapboxgl-ctrl-top-right {
  z-index: 10 !important;
}

// 确保MapboxDraw的canvas在最上层
.mapboxgl-map {
  .mapboxgl-canvas-container {
    position: relative;
    
    canvas {
      position: absolute;
      top: 0;
      left: 0;
    }
    
    // 确保draw canvas在最上层
    .mapboxgl-gl-draw {
      z-index: 2 !important;
      pointer-events: auto !important;
    }
  }
}

// 修复MapboxDraw控件的样式
.mapbox-gl-draw_ctrl-draw-btn {
  background-color: #fff !important;
  border: 1px solid #ddd !important;
}

// 确保绘制时的点和线可见
.mapbox-gl-draw_point,
.mapbox-gl-draw_line,
.mapbox-gl-draw_polygon {
  cursor: pointer !important;
}

// 强制显示顶点
.mapbox-gl-draw_vertex {
  display: block !important;
  cursor: move !important;
}

// 确保draw模式下鼠标事件正常
.mapboxgl-canvas-container.mapboxgl-interactive.draw-mode-active {
  cursor: crosshair !important;
  
  canvas {
    pointer-events: auto !important;
  }
}

// 调试样式 - 让MapboxDraw的元素更明显
.mapboxgl-canvas.mapboxgl-gl-draw {
  opacity: 1 !important;
  pointer-events: auto !important;
}

// 确保绘制控制按钮在最上层
.map-drawing-controls {
  z-index: 9999 !important;
}

// 绘制模式下的特殊处理
.draw-mode-active {
  // 所有非draw的canvas降低优先级
  .mapboxgl-canvas-container canvas:not(.mapboxgl-gl-draw) {
    z-index: 0 !important;
  }
  
  // draw canvas提高优先级
  .mapboxgl-canvas.mapboxgl-gl-draw {
    z-index: 10 !important;
  }
}